$(function(){
	//alert(navigator.userAgent)
	 wrap_size();
	 $(window).resize(function(){
	 	 wrap_size();
	 })
	//获取到url里phone_code
	$(".receive").attr("data-clipboard-text","qicheng://inviter?phone_code="+request("phone_code"))	//复制到剪贴板
	var clipboard = new Clipboard('.receive');
	$(".receive").click(function(){
		$("#prompt").text("已领取邀请码，快去下载吧。");
		$("#prompt").fadeIn(300,function(){
			setTimeout(function(){$("#prompt").fadeOut(300)},3000);
		});
		//页面滚动到底部
		var scroll_timer=setInterval(function(){
			$(window).scrollTop($(window).scrollTop()+20)
			if($(window).scrollTop()>($("body").height()-$(window).height()-1)){
				clearInterval(scroll_timer)
			}
		},10)
	})
	//下载链接
	$(".download_btn").click(function(){
		if(navigator.userAgent.indexOf("MicroMessenger")!=-1||navigator.userAgent.indexOf("Mobile MQQBrowser")!=-1){
        	$(".down_load_ts").show()
        	return false;
        }
		//ios
		if(navigator.userAgent.indexOf("iPhone")!=-1||navigator.userAgent.indexOf("iPad")!=-1||navigator.userAgent.indexOf("iPod")!=-1){
        	location.href="https://itunes.apple.com/cn/app/启程考驾照/id1279692444?l=zh&amp;amp;ls=1&amp;amp;mt=8"
        }
		//安卓
        else{
        	//其它方式打开
        	location.href="http://app.qcjkjg.com/download"
        }
		
	})
});
//设置页面最小高度，使背景充满整屏
function wrap_size(){
	$(".wrap").css("min-height",$(window).height());
}
